package br.com.lamaral.android.argcalc;

import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.RadioButton;

public class CalculadoradeArgumentosActivity extends Activity {
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);

		final Button ok = (Button) findViewById(R.id.buttonok);
		final RadioButton pas2007s = (RadioButton) findViewById(R.id.radiopas2007s);
		final RadioButton pas2007c = (RadioButton) findViewById(R.id.radiopas2007c);
		final RadioButton pas2008s = (RadioButton) findViewById(R.id.radiopas2008s);
		final RadioButton pas2008c = (RadioButton) findViewById(R.id.radiopas2008c);
		final Button sobre = (Button) findViewById(R.id.buttonsobre);
		final ImageButton sitedoluiz = (ImageButton) findViewById(R.id.btnsitedoluiz);

		ok.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				if (pas2007s.isChecked() == true) {
					startActivity(new Intent(
							CalculadoradeArgumentosActivity.this, PAS2007s.class));
				} else if (pas2007c.isChecked() == true) {
					startActivity(new Intent(
							CalculadoradeArgumentosActivity.this, PAS2007c.class));
				} else if (pas2008s.isChecked() == true) {
					startActivity(new Intent(
							CalculadoradeArgumentosActivity.this, PAS2008s.class));
				} else if (pas2008c.isChecked() == true) {
					startActivity(new Intent(
							CalculadoradeArgumentosActivity.this, PAS2008c.class));
				}
			}
		});
		sobre.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				startActivity(new Intent(CalculadoradeArgumentosActivity.this,
						Sobre.class));
			}
		});
		sitedoluiz.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.sitedoluiz.net/"));
				startActivity(browserIntent);
			}
		});

	}
}
